Skip to main content

Import

Usage

Return Type: UseQueryResult<TokenBalance[]>

The hook returns all properties from React Query’s UseQueryResult with token balance data. Here’s the detailed structure:

Properties

data

TokenBalance[] | undefined Array of token balance objects containing:
  • chainId: The chain ID where the balance was fetched from
  • accountAddress: The address whose balance was queried
  • contractAddress: The address of the native token (typically zero address)
  • balance: The balance amount in the token’s base units
  • contractType: The type of contract (e.g., ERC20, ERC721, ERC1155)
  • contractInfo: Additional contract information
  • tokenMetadata: Metadata about the token
  • blockHash: The hash of the block in which the balance was recorded
  • blockNumber: The number of the block in which the balance was recorded
  • uniqueCollectibles: The number of unique collectibles
  • isSummary: Whether the balance is a summary
  • tokenID: The ID of the token (for ERC721 and ERC1155 tokens)

isLoading

boolean Loading state for the data fetch.

isError

boolean Error state indicating if the query failed.

error

Error | null Any error that occurred during data fetching.

Parameters

The hook accepts two parameters:

args: GetNativeTokenBalanceArgs

options: HooksOptions